package com.sixth.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sixth.entity.AclPermission;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

@Component
public interface AclPermissionDao extends BaseMapper<AclPermission> {


    int permissioninsert(@Param("permissionId") String permissionId,@Param("name") String name,@Param("path") String path,@Param("icon") String icon,@Param("gmtCreate") Date gmtCreate,@Param("gmtModified") Date gmtModified,@Param("pid") String pid,@Param("type")Integer type);

    int deleteByPrimaryKey(String id);

    int insert(AclPermission record);

    int insertSelective(AclPermission record);

    AclPermission selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(AclPermission record);

    int updateByPrimaryKey(AclPermission record);

    List<AclPermission> findAllpermissionByPage(@Param("name") String name);

    int selectcount();

    //根据id查找permission
    AclPermission selectBypermissionId(@Param("permissionIds") String permissionIds);

    int permissioninsertsecond(@Param("permissionId")String permissionId,@Param("name") String name,@Param("path") String path,@Param("icon") String icon,@Param("gmtCreate") Date gmtCreate,@Param("gmtModified") Date gmtModified,@Param("pid") String pid,@Param("permissionType") Integer permissionType,@Param("permissionValue") String permissionValue);

    int updateAllpermissionIdsdel(@Param("permissionIds") String permissionIds);

    int updateBypermissionIddel(@Param("permissionIds")String permissionIds);

    //查询所有权限
    List<AclPermission> findAll();

    List<String> selectFindAllByRoleId(@Param("roleId") String roleId);

    //删除库里roleid的权限
    void deleteByRoleid(@Param("roleId") String roleId);

    int findcount();

    int insertRolePermission(@Param("id") String id,@Param("roleId") String roleId,@Param("permissionId") String permissionId,@Param("date") Date date);


    //根据permissionIds删除所有id和pid为permissionIds的
    //int deleteAllpermissionIds(@Param("permissionIds")String permissionIds);

    //删除id为permissionIds的
    //int deleteBypermissionId(@Param("permissionIds")String permissionIds);

    //int permissioninsertsecond(@Param("permissionId") String permissionId,@Param("name") String name,@Param("path") String path,@Param("icon") String icon,@Param("gmtCreate") Date gmtCreate,@Param("gmtModified") Date gmtModified,@Param("pid") String pid,@Param("permissionValue") String permissionValue, @Param("permissionType") Integer permissionType);

}